home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Very Best of Atari Inside
/
The Very Best of Atari Inside 1.iso
/
mint
/
mntinc20
/
assert.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-15
|
1KB
|
60 lines
/*
* assert.h
* sec 4.2 ansi draft
*/
/*
* 5/2/92 sb - changed __eprintf() to do its own work rather than calling
* fprintf(); this changed the calling sequence and made the __FAILED
* string unnecessary.
*/
/* Allow this file to be included multiple times
with different settings of NDEBUG. */
#undef assert
#ifndef _COMPILER_H
#include <compiler.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
__EXTERN void __eprintf __PROTO((const char *, const long, const char *));
__EXTERN void abort __PROTO((void));
#ifdef __cplusplus
}
#endif
#ifdef NDEBUG
#define assert(cond)
#else
#ifdef __STDC__
#define assert(cond) \
if(!(cond)) { __eprintf(#cond, (long)__LINE__, __FILE__); abort(); }
#else
#ifndef __SOZOBON__
/* There's a bug in Sozobon 2.0 whereby __LINE__ & __FILE__ are defined but
* testing #ifndef __?I?E__ comes out as if they aren't. */
#ifndef __LINE__
#define __LINE__ 0
#endif
#ifndef __FILE__
#define __FILE__ "unknown"
#endif
#endif /* __SOZOBON__ */
#define assert(cond) \
if(!(cond)) { __eprintf("cond", (long)__LINE__, __FILE__); abort(); }
#endif /* __STDC__ */
#endif /* NDEBUG */